using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

internal class ay : IDisposable
{
	[d]
	public static string a;

	protected Queue<av> b;

	private int m_c;

	private bool m_d;

	static ay()
	{
		ay.a = "bGljZW5zZS5zbg==";
		k.f();
	}

	public ay(int A_0)
	{
		this.b = new Queue<av>(A_0);
		for (int num = 0; num < A_0; num++)
		{
			this.b.Enqueue(c());
		}
	}

	public ay(int A_0, int A_1)
	{
		this.m_c = A_1;
		this.b = new Queue<av>(A_0);
		for (int num = 0; num < A_0; num++)
		{
			this.b.Enqueue(c());
		}
	}

	[SpecialName]
	public int b()
	{
		return this.b.Count;
	}

	protected av c()
	{
		av av2 = null;
		av2 = ((this.m_c <= 0) ? new av() : new av(this.m_c));
		av2.b = this;
		return av2;
	}

	public virtual av d()
	{
		lock (this.b)
		{
			av av2 = null;
			av2 = ((this.b.Count <= 0) ? c() : this.b.Dequeue());
			av2.e();
			return av2;
		}
	}

	public virtual void a(av A_0)
	{
		A_0.c = null;
		lock (this.b)
		{
			A_0.c = null;
			this.b.Enqueue(A_0);
		}
	}

	private void a()
	{
		while (this.b.Count > 0)
		{
			av av2 = this.b.Dequeue();
			av2.b = null;
			av2.SetBuffer(null, 0, 0);
		}
	}

	public void Dispose()
	{
		lock (this)
		{
			if (!this.m_d)
			{
				a();
				this.m_d = true;
			}
		}
	}
}
